#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

const int N = 1e5+5;
int flag[N],a[N],b[N],o[N],nex[N],ls[N];
int ou[N],T,n,ans[N],sta[N],l1,q[N],t;

void check(){
	int ch = 0;
	for(int i = 1; i <= 2*n; i++)
		if(ou[i] > q[i]){
			ch = 1;break;
		}
		else if(ou[i] < q[i]) break;
	if(ch == 1) for(int i = 1; i <= 2*n; i++) ou[i] = q[i];//cout << q[i];
//	cout << endl;
}

void pre(int l,int r){
	
	if(l == r){
		check();
		return;
	}
	if(sta[l1] == a[l]){
		q[++t] = 0;
		l1--;
		pre(l+1,r);
		t--;
		l1++;
	}
	if(sta[l1] == a[r]){
		q[++t] = 1;
		l1--;
		pre(l,r-1);
		q[t] = 0;
		t--;
		l1++;
	}
}

void dfs(int l,int r){
if(T == 1)cout <<l << " " << r << endl;for(int i =1; i <= n; i++) cout << sta[i] << " ";cout<<endl;
	if(r-l+1 == n){
		pre(l,r);
		return;
	}
	if(!flag[a[l]]){
		flag[a[l]] = 1;
		sta[++l1] = a[l];
		t++;
		dfs(l+1,r);
		flag[a[l]] = 0;
		t--;
		l1--;
	}
	if(!flag[a[r]]){
		flag[a[r]] = 1;
		q[++t] = 1;
		sta[++l1] = a[r];
		dfs(l,r-1);
		t--;
		flag[a[r]] = 0;
		l1--;
	}
}

int main(){
	freopen("palin.in","r",stdin);
	freopen("palin.out","w",stdout);
	cin >> T;
	while(T--){
		cin >> n;
		for(int i = 1; i <= 2*n; i++) ou[i] = 2;
		memset(ans,0,sizeof(ans));
		memset(flag,0,sizeof(flag));
		memset(ls,0,sizeof(ls));
		memset(nex,0,sizeof(nex));
		memset(b,0,sizeof(b));
		for(int i = 1; i <= 2*n; i++){
			cin >> a[i];
			if(b[a[i]]) nex[b[a[i]]] = i,ls[i] = b[a[i]];
			b[a[i]] = i;
		}
	//	for(int i = 1; i <= 2*n; i++) cout << nex[i] << " " << ls[i] << endl;
		dfs(1,2*n);
		int ch = 0;
		for(int i = 1; i <= 2*n; i++) if(ou[i] == 2) ch = 1;
		if(ch == 1){
			cout << "-1" << endl;
			continue;
			}
		for(int i = 1; i <= 2*n; i++)
			if(ou[i] == 1) cout << "R";else cout << "L";
			cout << endl;
	}
	return 0;
}
